package com.yaj.controller;


import com.yaj.base.ResponseResult;
import com.yaj.dto.UserDto;
import com.yaj.enums.BasicEnum;
import com.yaj.pojo.User;
import com.yaj.service.IUserService;
import com.yaj.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaojiu
 * @since 2024-08-19
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private IUserService userService;

    @PostMapping
    public ResponseResult<UserVo> login(@RequestBody UserDto dto){
        UserVo user = userService.login(dto);
        return ResponseResult.success(user);
    }
}
